import 'auth_repository.dart';
import 'impl/api_auth_repository.dart';
import 'impl/mock_auth_repository.dart';

enum AuthRepositoryType { mock, api }

class AuthRepositoryFactory {
  static AuthRepositoryType _currentType = AuthRepositoryType.mock;
  
  static void setRepositoryType(AuthRepositoryType type) {
    _currentType = type;
  }
  
  static AuthRepositoryType get currentType => _currentType;
  
  static AuthRepository create() {
    switch (_currentType) {
      case AuthRepositoryType.mock:
        return MockAuthRepository();
      case AuthRepositoryType.api:
        return ApiAuthRepository();
    }
  }
  
  static bool get isUsingMock => _currentType == AuthRepositoryType.mock;
  static bool get isUsingApi => _currentType == AuthRepositoryType.api;
}